package comnet.rmi;

import java.rmi.Naming;
import java.rmi.Remote;
import static java.rmi.registry.LocateRegistry.createRegistry;

/**
 * @author Mikko Puustinen (mikko.puustinen@gmail.com)
 * @version 0.1, 2008-jan-15
 */
public class RmiServerRunner {
    public static void main(String[] args) {
        try {
            try {
                createRegistry(1099);
                System.out.println("RMI registry ready.");
            } catch (Exception e) {
                System.out.println("Exception starting RMI registry:");
                e.printStackTrace();
            }
            Remote rs = new RmiServer();
            Naming.rebind("RmiChatServer", rs);
            System.out.println("Server running...");
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}